package com.tushare.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tushare.dto.StockInfoDto;
import com.tushare.entity.StockBasic;
import com.tushare.mapper.StockBasicMapper;
import com.tushare.service.IStockBasicService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2021-03-08
 */
@Service
public class StockBasicServiceImpl extends ServiceImpl<StockBasicMapper, StockBasic> implements IStockBasicService {

    @Override
    public boolean saveStockBasics(List<StockBasic> list) {
        if (list == null) {
            return false;
        }
        if (list.size() == 0) {
            return true;
        }
        return saveBatch(list);
    }

    @Override
    public List<StockBasic> getAllStockBasic() {
        return getBaseMapper().getAllStockBasic();
    }

    @Override
    public List<StockInfoDto> getAllStockInfoDto() {
        return getBaseMapper().getAllStockInfoDto();
    }

    @Override
    public List<StockInfoDto> getAllHighStockInfoDto() {
        return getBaseMapper().getAllHighStockInfoDto();
    }

    @Override
    public boolean deleteAllStockBasic() {
        return getBaseMapper().deleteAllStockBasic();
    }
}
